/********************************************************************
* Copyright (c) 2013,TGS,All rights reserved.
* fileName:	DxfRenderModel.h	
* created:	2013/07/24 15:30

* version:	1.6
* detail: 
*********************************************************************/

#pragma once

#include "DxfLayer.h"
#include <TGS/GeoMath2.0/Envelope.h>
#include <vector>
#include <map>
#include <QString>
#include <QColor>

namespace TGS{
namespace MapControl{

	class RenderContext;
}
}

class DxfEntity;

class DxfRenderModel
{
	typedef TGS::MapControl::RenderContext RenderContext;
	typedef TGS::GeoMath::Envelope Envelope;
public:
	DxfRenderModel(void);
	~DxfRenderModel(void);
public:
	QColor getLayerColor(const QString& layerName) { return _dxLayers[layerName].getColor(); }
	void addEntity(const QString& layerName, DxfEntity* entity);
	void addLayer(const DxfLayer& layer) { _dxLayers[layer.getLayerName()] = layer; }
	bool haveData() const { return !_dxLayers.empty(); }
public:
	void render(RenderContext* renderContext);
	 Envelope getEnvelope() const;
public:
	std::map<QString, DxfLayer>	_dxLayers;
};

